<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" 
      xmlns:sec="http://www.pollix.at/thymeleaf/shiro">
<head th:replace="admin/common/html/head :: head_Normal(~{::title},~{::link},~{::style})">

<title th:text=${title}></title>
<!-- 这儿引用单独的css link -->
<!-- Ladda for Bootstrap 3按钮加载进度插件 -->
<link rel="stylesheet" th:href="@{/static/admin/assets/js/button/ladda/ladda.min.css}">
<!-- bootstrap-table表单样式 -->
<link th:href="@{/static/admin/assets/js/bootstrap/css/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>

<!-- jquery向导插件stepy -->
<link th:href="@{/static/admin/assets/js/wizard/css/jquery.steps.css}" rel="stylesheet"/>

<style type="text/css">
/**
*这里写单独的css样式
*/

</style>

</head>

<body>




<!-- ###############################代码编写处############################### -->

<!-- 右边内容 -->
<div class="wrap-fluid">
    <div class="container-fluid paper-wrap bevel tlbr">
        <!-- 内容 -->

            <div class="row">
                    <div class="col-sm-12">
                        <div class="nest" id="elementClose">
                            <div class="title-alt">
                                <h6> 全局配置表单</h6>
                                <div class="titleClose">
                                    <a class="gone" href="#elementClose">
                                        <span class="entypo-cancel"></span>
                                    </a>
                                </div>
                                <div class="titleToggle">
                                    <a class="nav-toggle-alt" href="#element">
                                        <span class="entypo-up-open"></span>
                                    </a>
                                </div>

                            </div>

                            <div class="body-nest" id="element">

                                <div class="panel-body">
                                
	                                <div class="body-nest" id="alert">
		                                <div class="alert alert-info">
		                                    <button data-dismiss="alert" class="close" type="button">×</button>
		                                    <span class="entypo-info-circled"></span>
		                                    <strong>说明!</strong>&nbsp;&nbsp; 全局参数配置(建议配置在配置文件中.在页面配置,当项目重启将重置参数)
		                                </div>
	                            	</div>
                             		
                                    <form id="form-add" class="form-horizontal bucket-form" th:object="${autoConfig}">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">根路径</label>
                                            <div class="col-sm-6">
                                                <input type="text" name="parentPath" id="parentPath" class="form-control" th:value="*{parentPath}">
                                                <span class="help-block">生成代码需要存放的项目根路径</span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">代码父包</label>
                                            <div class="col-sm-6">
                                                <input type="text" name="parentPack" id="parentPack" class="form-control" th:value="*{parentPack}">
                                                <span class="help-block">如父包是cn.zhangsw </span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">覆盖生成</label>
                                            <div class="col-sm-6">
                                                <select id="cover" name="cover" class="form-control" th:field="*{cover}">
                                                      	 <option value="false">不覆盖</option>
                                                         <option value="true">覆盖</option>
                                                </select>
                                                <span class="help-block">谨慎使用覆盖生成.覆盖初始化所有代码</span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">表前缀</label>
                                            <div class="col-sm-6">
                                                <input type="text" name="tablePrefix" class="form-control" th:value="*{tablePrefix}">
                                                <span class="help-block">数据库{表前缀}_test</span>
                                            </div>
                                        </div>
                                         <div class="form-group">
                                            <label class="col-sm-3 control-label">java位置</label>
                                            <div class="col-sm-6">
                                                <input type="text" name="javaSource" id="javaSource" class="form-control" th:value="*{javaSource}">
                                                 <span class="help-block">java的源文件目录.一般是src/main/java</span>
                                            </div>
                                         </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">resource位置</label>
                                            <div class="col-sm-6">
                                                <input type="text"  name="resources" id="resources" class="form-control" th:value="*{resources}">
                                                 <span class="help-block">resource的源文件目录.一般是src/main/resources</span>
                                            </div>
                                         </div>

                                         <div class="form-group">
                                            <label class="col-sm-3 control-label">xml目录</label>
                                            <div class="col-sm-6">
                                                <input type="text"  name="xmlPath" id="xmlPath" class="form-control" th:value="*{xmlPath}">
                                                 <span class="help-block">mybatis XML存放的文件夹</span>
                                            </div>
                                         </div>

                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">mapper包名</label>
                                            <div class="col-sm-6">
                                                <input type="text"  name="daoPackageName" id="daoPackageName" class="form-control" th:value="*{daoPackageName}">
                                                <span class="help-block">例：dao   全限定名就是上面的代码父包+模块名+dao 即cn.zhangsw.dao</span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">mapper接口后缀</label>
                                            <div class="col-sm-6">
                                                <input type="text"  name="daoNameSuffix" id="daoNameSuffix" class="form-control" th:value="*{daoNameSuffix}">
                                                <span class="help-block">例：UserMapper.class 同时 UserMapper.xml</span>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">javaBean包名</label>
                                            <div class="col-sm-6">
                                                <input type="text"  name="beanPackageName" id="beanPackageName" class="form-control" th:value="*{beanPackageName}">
                                                <span class="help-block">例：model  全限定名就是 cn.zhangsw.generator.model</span>
                                            </div>
                                        </div>

                                         <div class="form-group">
                                            <label class="col-sm-3 control-label">javaBean尾缀</label>
                                            <div class="col-sm-6">
                                                <input type="text"  name="beanNameSuffix" id="beanNameSuffix" class="form-control" th:value="*{beanNameSuffix}">
                                                 <span class="help-block">javaBean尾缀 例 bean   类名就是UserBean，xxxBean</span>
                                            </div>
                                         </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">service包名</label>
                                            <div class="col-sm-6">
                                                <input type="text" name="servicePackageName" id="servicePackageName" class="form-control" th:value="*{servicePackageName}">
                                                <span class="help-block">service包名 例：service，全限定名就是cn.zhangsw.service</span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">service尾缀</label>
                                            <div class="col-sm-6">
                                                <input type="text" name="serviceNameSuffix" id="serviceNameSuffix" class="form-control" th:value="*{serviceNameSuffix}">
                                                <span class="help-block">service尾缀 例：service  类名就是UserService，xxxService</span>
                                            </div>
                                        </div>

                                         <div class="form-group">
                                            <label class="col-sm-3 control-label">controller包名</label>
                                            <div class="col-sm-6">
                                                <input type="text"   name="controllerPackageName" id="controllerPackageName" class="form-control" th:value="*{controllerPackageName}">
                                                 <span class="help-block">controller包名 例：controller，全限定名就是cn.zhangsw.controller</span>
                                            </div>
                                         </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">controller尾缀</label>
                                            <div class="col-sm-6">
                                                <input type="text"   name="controllerNameSuffix" id="controllerNameSuffix" class="form-control" th:value="*{controllerNameSuffix}">
                                                <span class="help-block">controller尾缀 例：controller  类名就是UserController，xxxController</span>
                                            </div>
                                        </div>

                                         <div class="form-group">
                                            <label class="col-sm-3 control-label">开发者名字</label>
                                            <div class="col-sm-6">
                                                <input type="text" name="author" id="author" class="form-control" th:value="*{author}">
                                                 <span class="help-block"></span>
                                            </div>
                                         </div>
                                         <div class="form-group">
											<div class="form-control-static col-sm-offset-3">
												<button type="submit" class="btn btn-primary">提交</button>
												<button  class="btn btn-danger" type="reset">清除</button>
											</div>
										</div>
                                         
                                    </form>
                                </div>

                            </div>

                        </div>
                    </div>
                </div>
            
            
            
            <!-- 结束内容 -->
        </div>
    </div>
</div>
<!-- 结束右边内容 -->
<!-- ###############################代码编写处end############################### -->







<!-- 右侧隐藏滑块内容 -->
<div th:include="admin/common/html/rightHide :: rightHide">
    
</div>
   <!-- END 右侧隐藏滑块内容-->

<!-- 通用js -->
<div th:include="admin/common/html/js :: onload_js">
   
</div>
<!-- bootstarp 表格 -->
<script th:src="@{/static/admin/assets/js/bootstrap/js/bootstrap-table/bootstrap-table.min.js}" type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/js/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}" type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/js/base_list.js}" type="text/javascript"></script>
<!-- 导出 -->
<script th:src="@{/static/admin/assets/js/bootstrap/extensions/export/bootstrap-table-export.js}" type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/extensions/export/tableExport.js}" type="text/javascript"></script>

<!-- 弹窗 -->
<script th:src="@{/static/admin/assets/js/layer/layer.js}" type="text/javascript"></script>
<!-- 遮罩层 -->
<script th:src="@{/static/admin/assets/js/blockUI/jquery.blockUI.js}" type="text/javascript"></script>
<!-- jquery向导插件stepy -->
<script type="text/javascript" th:src="@{/static/admin/assets/js/wizard/build/jquery.steps.js}"></script>
<!-- 提示插件  -->
<script type="text/javascript" th:src="@{/static/admin/assets/js/tip/jquery.tooltipster.js}"></script>

<script type="text/javascript">
<!-- jquery-export 表格导出插件 -->


$("#form-add").validate({
    rules:{
        beanPackageName:{
            required:true
        },
        daoPackageName:{
            required:true

        },
        controllerPackageName:{
            required:true

        },
        servicePackageName:{
            required:true

        }
    },
    messages: {

        beanPackageName: {
            required: "包名必填"
        },
        daoPackageName: {
            required: "包名必填"
        },
        controllerPackageName: {
            required: "包名必填"
        },
        servicePackageName: {
            required: "包名必填"
        }
    },
    submitHandler:function(form){
        add();
    }
});

  /**
   * 用户添加方法
   */
  function add() {
  	var dataFormJson=$("#form-add").serialize();
  	$.ajax({
  		cache : true,
  		type : "POST",
  		url : rootPath + "/addGlobal",
  		data : dataFormJson,
  		async : false,
  		error : function(request) {
  			$.modal.alertError("系统错误");
  		},
  		success : function(data) {
  			$.operate.saveSuccess(data);
  		}
  	});
  }

</script>


<script type="text/javascript">



</script>



</body>


</html>
